package refactor.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import refactor.entity.EventLog;
import refactor.mapper.EventLogMapper;
import refactor.service.IEventLogService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 记录系统中设备设施发生的所有事件 服务实现类
 * </p>
 *
 * @author 杨健
 * @since 2019-08-19
 */
@Service
public class EventLogServiceImpl extends ServiceImpl<EventLogMapper, EventLog> implements IEventLogService {
    private EventLogMapper eventLogMapper;

    @Autowired
    public void setEventLogMapper(EventLogMapper eventLogMapper) {
        this.eventLogMapper = eventLogMapper;
    }

    @Override
    public int countAllCasualApplicationByRegionId(Integer regionId) {
        return eventLogMapper.countAllCasualApplicationByRegionId(regionId);
    }

    @Override
    public int countAllCasualApplicationByRegionIdNotHandle(Integer regionId) {
        return eventLogMapper.countAllCasualApplicationByRegionIdNotHandle(regionId);
    }

    @Override
    public List<Map<String, Object>> getWarningMessage(int regionId) {
        return eventLogMapper.getWarningMessage(regionId);
    }
}
